Skip to content

perf(console): an object list and a record page no longer load the Studio designer's string table on first paint - #37589

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-xtck3b
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-xtck3b

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Part of #37444. This is slice C of that card: route-level JS an object list and a record page load before first paint that they do not need. The card stays open: the production re-measure (card comment 7193730951) shows no single seam brings the three pages under 2.5 s, and the other slices (eager-closure diet, boot waterfall, render CPU) are filed by the seat as their own cards.

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:所有用户打开对象列表页和记录页时,少下载约 94 KB 用不到的 Studio 设计器文字;页面内容和保存行为都不变。
  • 为什么做:属于「首屏加载 2.5 秒」这张卡拆出的第一刀(C)。记录页首屏中位数从 4223 降到 4066 毫秒,列表页和首页的变化在测量误差内。
  • 出错会怎样:最坏情况是设计器打开时某段文字显示慢一拍,或某个保存入口找不到辅助函数而报错;改动只是搬家加转出口,可以整笔撤回。
  • 要你做什么:无。

What changes

Two component modules in @object-ui/app-shell held small pure helpers next to React components that import the designer's t() (views/metadata-admin/i18n.ts) and, through it, the studio namespace's English catalogue (@object-ui/i18n/namespaces/studio, its own 69 KB gzipped chunk). The running app's save paths that load with a list or record page import those helpers, so the static import pulled the whole designer table, the Studio header and the Customize controls into both pages' first load.

  • views/studio-design/customizeOverride.ts (new): the Customize door's pure half, moved verbatim out of StudioCustomizeControls.tsx (STUDIO_CUSTOMIZE_TYPES, isStudioCustomizeType, declaredOverrideOf, overrideDraftBody, customizeDoorWalled, useCustomizeDoorWalled, OBJECT_EXTENSION_TYPE, extensionFieldName, objectExtensionBodyOf, ObjectExtensionBody).
  • views/metadata-admin/draftVersionGuard.ts (new): the draft-version guard's pure half, moved verbatim out of DraftConflictDialog.tsx (the conflict predicates, the pins, readDraftForSave, DraftVersionGuard, heldDraftVersionOf and their types). useDraftSaveGuard and the dialog, which render and translate, stay where they were.
  • Both old modules re-export every moved name, so every other importer (the designer's pillars, inspectors and editors) is unchanged.
  • The runtime importers now read the new modules: runtime-metadata-persistence.ts, recordTabsConfigSave.ts, objectExtensionArrangementSave.ts, RecordTabsConfig.tsx, ReportView.tsx, DashboardView.tsx, metadata-admin/PageShell.tsx, setup/publicForms.ts, objectViewViewCrud.tsx, metadata-admin/detailSaveAtOnce.ts, layout/designModeMenuSave.ts, layout/designModeHeaderPinsSave.ts. Three tests that mocked useCustomizeDoorWalled on StudioCustomizeControls now mock it on customizeOverride, where the hook lives.

No behaviour, string, route or saved document changes. Changeset: patch on @object-ui/app-shell, @object-ui/console, @objectstack/console (the Console dist ships the change).

Tests

  • New views/__tests__/firstScreenStudioCatalogue-37444.test.ts: walks each first-screen save path's static relative imports in source (type-only imports and import() excluded) and asserts none reaches the designer string table; the walk proves it sees the edge by requiring DraftConflictDialog.tsx and StudioCustomizeControls.tsx to reach it, and the two new modules import no component module. Ablation: pointing recordTabsConfigSave.ts back at DraftConflictDialog.js reds views/recordTabsConfigSave.ts reaches no designer string table through static imports (1 failed, 5 passed); restored with git checkout HEAD --.
  • @object-ui/app-shell tests touching any moved name or edited importer: 85 files, 977 tests passed (pnpm exec vitest run --maxWorkers=2 over the 85 files, from ui/); the new file 6/6.
  • tsc --noEmit in ui/packages/app-shell exit 0; tsc -p tsconfig.test.json exit 0.
  • eslint over the 20 changed ui/ files: 0 errors (181 warnings, all react-refresh/only-export-components of the kind these files already carried).

Acceptance notes

  • Measured effect (production build, the card's conditions) — tree: this branch (688b77ff source; Console rebuilt with pnpm console:build), objectstack start with NODE_ENV=production, Lighthouse 13.6.0 desktop preset, Chrome for Testing 158 headless, 4-core container, 5 runs per page, every run on the requested page, signed in, cold cache:

    Page Before (main 021524cd) After (this branch)
    Home 3626 (3639, 3626, 3538, 3509, 3685) 3669 (3688, 3643, 3735, 3669, 3662)
    Object list 4611 (4595, 4611, 4483, 4664, 4771) 4644 (4563, 4784, 4644, 4508, 4651)
    Record page 4223 (4223, 4238, 4285, 4168, 4188) 4066 (4201, 4187, 4042, 4066, 4051)

    Script bytes before LCP: list 2443 → 2349 KB, record 2340 → 2246 KB, home unchanged (1976 KB). The record page gains 157 ms; the list page's bytes drop by the same 94 KB but its LCP does not move, because its critical path is the serial API chain that the chunk loaded beside; home does not load these chunks. All three pages still miss 2500 ms, as the card's reading predicted for any single slice.

  • Static route closures read off the built Console (ObjectView / RecordDetailView, non-eager chunks reachable by static import): 441 → 347 KB and 347 → 254 KB gzipped. The eager closure is unchanged (1,991,173 → 1,991,266 bytes gzipped; check:eager-closure reads it in CI).

  • The record page's other large route chunk, plugin-grid (192 KB gzipped), was looked at and left: rolldown groups plugin-detail (the record page's own renderer: DetailView, RelatedList, the activity timeline) into it, so it is the page's own code, not a stray. Splitting ImportWizard / bulk-action code out of it is a possible later cut inside the eager/route diet slices.

  • layout/designModeMenuSave.ts also now reads the new modules, but still reaches the designer table through the app-nav canvas it imports; it loads with design mode, not with a list or record page, so the pin does not list it.

  • L2 owed (not self-reviewed): a contract-tier read is not needed (no governed path; no spec, no protocol change); the seat's L1 reads the CI check-runs.

Verification

Two-minute check: cd ui && pnpm exec vitest run packages/app-shell/src/views/__tests__/firstScreenStudioCatalogue-37444.test.ts → 6 passed. In a built Console, the RecordDetailView-*.js and ObjectView-*.js chunks no longer import i18n-ns-studio-en-*.js through any static chain.

Read first: views/metadata-admin/draftVersionGuard.ts (the guard class moved verbatim; check no symbol was left behind that useDraftSaveGuard needs), views/studio-design/StudioCustomizeControls.tsx (the re-export block and the trimmed imports), the three test mocks retargeted to customizeOverride.

Local gates (derived by dispatch-gates.mjs --commands at the final head)

Head 688b77ff. 39 derived, 39 run, each exit captured before any pipe; dispatch-gates.mjs --ran: 39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN (exit 0). Every other family (lint, type-check lanes, Test UI, Build and E2E UI, the eager-closure budget) is CI's; this PR's check-runs are the record.

  • node scripts/check-adr-0087-registration.mjs --base origin/main → exit 0
  • node scripts/check-adr-0087-registration.mjs --self-test → exit 0
  • node scripts/check-changeset-no-major.mjs --base origin/main → exit 0
  • node scripts/check-closing-keyword-parity.mjs → exit 0
  • node scripts/check-closing-keyword-parity.mjs --self-test → exit 0
  • node scripts/check-comment-mask-corpus.mjs → exit 0
  • node scripts/check-empty-changeset.mjs --base origin/main → exit 0
  • node scripts/check-empty-changeset.mjs --self-test → exit 0
  • node scripts/check-sdui-manifest.mjs → exit 0
  • node scripts/check-sdui-manifest.mjs --self-test → exit 0
  • node scripts/ci/snapshot-next.mjs --self-test → exit 0
  • node scripts/pm/check-governed-queue-guard.mjs --self-test → exit 0
  • node scripts/pm/release-rehearsal-clone.mjs --self-test → exit 0
  • node scripts/release-pending-publish.mjs --self-test → exit 0
  • pnpm --dir ui exec vitest run scripts/ → exit 0
  • pnpm --filter @objectstack/spec run check:duration-unit-keys → exit 0
  • pnpm check:adr-anchors → exit 0
  • pnpm check:adr-symbol-anchors → exit 0
  • pnpm check:changeset-gate-self-tests → exit 0
  • pnpm check:closed-ceremony-text → exit 0
  • pnpm check:cross-package-test-inputs → exit 0
  • pnpm check:dispatcher-error-vocabulary → exit 0
  • pnpm check:driver-memory-census → exit 0
  • pnpm check:engine-double-contract → exit 0
  • pnpm check:gitlink-declared → exit 0
  • pnpm check:nul-bytes → exit 0
  • pnpm check:published-files → exit 0
  • pnpm check:query-options-erasure → exit 0
  • pnpm check:refd-timer-probe → exit 0
  • pnpm check:registry-log-declared → exit 0
  • pnpm check:rest-log-spy-declared → exit 0
  • pnpm check:skill-identifier-liveness → exit 0
  • pnpm check:test-source-alias → exit 0
  • pnpm check:tier-file-adoption → exit 0
  • pnpm check:type-check-coverage → exit 0
  • pnpm check:type-check-debt → exit 0
  • pnpm check:undeclared-dep-imports → exit 0
  • pnpm check:watch-hint-literal → exit 0
  • pnpm check:where-matcher → exit 0

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgU8Bf564ZGXi4MfHWb


Generated by Claude Code

@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head 688b77f · card #37444 (slice C) · area s2-ux · 2026-11-26T14:46Z

L1 checklist

Tier: S. Landing: ready + auto-merge by this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 14:46
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 4805d83 Nov 26, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-xtck3b branch November 26, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants